home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
games
/
nhak_src.zip
/
INSTALL.DOS
< prev
next >
Wrap
Text File
|
1993-03-16
|
14KB
|
309 lines
Instructions for compiling and installing NetHack 3.0
on an MS-DOS, TOS, or OS/2 system
=====================================================
(or, How to make PC, ST, and OS/2 NetHack 3.0)
Last revision: 22 May 1990
Credit for ST and OS/2 NetHack 3.0 goes to Eric Smith and Timo Hakulinen,
respectively. Additional credit should be given to Steve Creps and
Mike Threepoint for PC NetHack.
*** Note: if you intend to compile NetHack on an MS-DOS PC using OVERLAY,
please turn to the instructions in Install.ovl. The overlay version is
currently available only for MSC.
1. Make sure all the NetHack files are in the appropriate directory structure.
You should have a main directory with subdirectories src, include, auxil,
others, amiga, mac, and vms. If you do not follow this structure, the
Makefile will not function properly.
All the shared and UNIX-specific .c files and the source Makefile belong
in src; all the PC .c files and make files belong in others; all the .h
files belong in include; other assorted files belong in auxil. We will
not need any of the files from the amiga, mac, and vms directories.
If you downloaded or ftp'd the sources from a UNIX system, the lines
will probably end in UNIX-style newlines, instead of the carriage
return and line feed pairs used by DOS and OS/2. Turbo C 2.0 in
particular dislikes these; you'll have to convert them (with a utility
like Rahul Dhesi's "flip"). Also, every file should end with an empty
line, because both Microsoft C has a habit of ignoring the last line of
each file. (TOS compilers generally don't have either problem).
2. Copy the .c files from the others directory to your src directory
based on the following decisions. (You will probably want to include
all of these files.)
You will definitely need pc*.c and msdos.c.
The file termcap.uu is the fixed version of the Fred Fish termcap library.
You will need to run a uudecode utility on it to generate the file
termcap.arc. termcap.arc contains several files of termcap routines.
Using them with NetHack involves very little knowledge of the UNIX concept
of a termcap database; mostly you need to know enough to set a TERM
environment variable. You can unarc termcap.arc here in the others
directory, but if you are going to use it, it is probably best to unarc a
copy in the src directory. That way you will not miss copying any
files over. Wherever you unarc it, get rid of the included makefile
since a better version has been provided as Makefile.lib.
random.c is only needed if you want the high-quality random number
generation routines.
trampoli.c and ovlmgr.obj files are needed for the MS-DOS overlays.
You may ignore these.
TOS users should use others/lev_lex.c instead of src/lev_lex.c.
MS-DOS users should be able to use either, but the one in src
is smaller. If you have flex or some other lex work-alike, use
that to produce lev_lex.c from lev_comp.l.
Obviously, TOS users don't need the MS-DOS overlay functions.
Moreover, the GCC "curses" library has termcap routines built
in, so if you have this you don't need termcap.arc.
3. Now look at Makefile.* in your others directory. Consult the list below
and pick out the makefile most appropriate to your system. Rename this
file to "Makefile" (no extension), and move it into your src directory.
DOS:
Microsoft C 5.0+ Makefile.msc
Microsoft C 4.0 Makefile.pc
Turbo C 2.0 Makefile.tcc
OS/2:
Microsoft C 5.1 Makefile.os2
TOS:
GCC 1.34 Makefile.st
The PC NetHack makefiles are set up for NDMAKE, a public domain
"make" utility. Both Microsoft's and Borland's "make" leave much to
be desired. It is worth the extra effort to get NDMAKE if you don't
already have it. Among other things, NDMAKE automatically generates
link response files when the link command involves so many objects
that the command would become longer than DOS can handle. If you must
use Microsoft's or Borland's "make", you'll need to edit the makefile
into a form your make can use, and add instructions to generate a link
response file.
Makefile.os2 can also be used with Microsoft NMAKE, which is shipped with
new versions of MS languages. This "make", although slightly incompatible
with NDMAKE, is powerful enough to make NetHack. Since NDMAKE only works
in DOS, the only way to compile NetHack in OS/2 currently is to use NMAKE.
However, when cross-compiling for OS/2 in DOS, NDMAKE is a better choice
because it requires less RAM for itself. See Makefile.os2 for more
information.
The ST NetHack makefile should work with either the widely available
PD make, or (much better) GNU Make.
If you're using a different compiler, you will have to adapt one of
the makefiles to your needs. In particular, change the CC and CFLAGS
macros to your C compiler's file name and the parameters to pass it.
For DOS users, if you are going to be constructing the Fred Fish termlib
you will need the Makefile.lib. Copy this to your source directory too,
and do not change its name.
Makefile.top in the top directory and Makefile.aux(il) in the
auxil directory are for UNIX NetHack. You may delete them.
4. Now go to the include subdirectory to edit a couple of the header files
there.
First edit config.h according to the comments to match your system and
desired set of features. Mostly you need to check the WIZARD option,
make sure the HACKDIR is set properly, and check TERMLIB and COMPRESS.
Also edit pcconf.h for PC or OS/2 NetHack, or tosconf.h for ST NetHack.
pcconf.h should not need much editing. If you are not going to include
random.c or termcap.uu you will need to comment out RANDOM or TERMLIB
respectively. You will definitely need to comment out OVERLAY.
Commenting out the #define TERMLIB in pcconf.h/tosconf.h to disable
use of termcap routines (relying on the ANSI_DEFAULT feature) will make
your job a bit easier. However, you can compile with both and simply
not set your TERM variable if you do not wish to use the termcap file
settings.
ST and OS/2 NetHackers can skip to the next section, since the entire game
will fit in less than one megabyte.
PC NetHackers:
To compile under MS-DOS, you must either produce an overlaid executable or
make some very difficult decisions about which features to include.
The base size of a PC NetHack executable, with no extra features or
overlays, will be around 570 (or better) kilobytes. Anything over 590K
is likely not to work. Here's an incomplete and outdated list of the
approximate costs of various additional features in terms of executable
size, using Microsoft C:
WIZARD 3K
LOGFILE
NEWS
COMPRESS 2K
ZEROCOMP
CHDIR
POLYSELF 31K
THEOLOGY 11K
SOUNDS 6K
KICK
THRONES 3K
FOUNTAINS 2K
SINKS 5K
ALTARS 4K
WALLIFIED_MAZE 1K
REINCARNATION 7K
STRONGHOLD 13K
ORACLE
MEDUSA
KOPS
ARMY 1K
WORM
GOLEMS 2K
INFERNO
SEDUCE
TOLKIEN
PROBING 1K
WALKIES 4K
SHIRT
MUSIC 6K
TUTTI_FRUTTI
SPELLS 10K
NAMED_ITEMS
ELBERETH 3K
EXPLORE_MODE 2K
HARD
REDO 1K
COM_COMPL 1K
CLIPPING
DGK 7K
TERMLIB
RANDOM 1K
SHELL
TEXTCOLOR 1K
Using Turbo C, we eked by with just WIZARD, ZEROCOMP, BITFIELDS, ELBERETH,
HARD, REDO, DGK and TEXTCOLOR.
5. If you're using a compiler not in the list in step 3, you may want to look
through system.h, in the include directory. This file matches the return
and parameter types for system calls and library routines with various
flavors of compilers and operating systems. Leaving this file alone is
unlikely to cause problems, but if you get compile errors with any
functions in the standard library, it's worth checking the declarations
there.
6. If you want to change the high score list behavior, examine the top of
topten.c, in the src directory. You may want to change the definitions of
PERSMAX, POINTSMIN, and ENTRYMAX. I set POINTSMIN to 51 and ENTRYMAX to
50 to keep the size of the score list down.
7. Go to the src directory and edit the top of your Makefile. Be sure the
directory you want the game installed in actually exists.
If you elected not to use the high-quality BSD random number routines by
commenting out RANDOM in pcconf.h or tosconf.h, comment out (or set equal
to nothing) the RANDOM macro in your Makefile.
If you elected to use Fred Fish's termcap library (bundled in as
termcap.arc), you will have to generate termcap.lib from those sources
by typing make -f makefile.lib termlib.lib. DOS / OS/2 users must set the
TERMLIB option in Makefile.msc / Makefile.os2 to link in the resulting
termlib.lib.
If you are recompiling after patching your sources, or if you got your
files from somewhere other than the official distribution, "touch
makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
lest potentially troublesome timestamps fool "make".
8. Now, enter "make all", and take a long siesta; your computer will be
occupied for a long time. If all goes well, you will get an executable.
If you tried to compile in too many features, you will probably get a
dysfunctional executable, and will have to start over.
Hint: If you're short on memory, you might enter "make -n all
>script.bat", and then in DOS enter "script", or in TOS use the Gulam
command "source script.bat". GCC users will be short on memory if
they only have 2 megabytes. Indeed, some files will not compile in
2 megabytes with the GCC 1.36; for these you'll either have to turn
off the -O option or use an earlier version of the GCC.
9. Make sure the support files-- data, rumors, cmdhelp, opthelp, help, hh,
history, license, and oracles (if ORACLES was #define'd)-- were copied
to the game directory. If not, move them there from the auxil directory
yourself. rumors can be created manually by entering "makedefs -r";
data by entering "makedefs -d".
If you compiled in the compiled levels (if STRONGHOLD was #define'd), make
sure castle, tower?, and possibly endgame are there, too. They can be
created manually by entering "lev_comp filename.des", where filename.des
is the appropriate description file (found in the auxil directory).
10. Go to the others directory. Copy NetHack.cnf, or Atari.cnf for TOS, to
your game directory as "NetHack.cnf". Edit it to reflect your particular
setup and personal preferences, following the comments.
If you compiled in the TERMLIB feature, also move the "termcap" file to
your game directory. (Note: GCC's termcap routines have built-in
defaults, so the termcap file is not necessary with that compiler.)
To use funky graphics charaters in TOS, uudecode "atarifnt.uue" and unarc
the resulting "atarifnt.arc". This contains a program to run that makes
some line graphics characters available to NetHack. To use them, uncomment
the appropriate line in your NetHack.cnf file, and run the program before
running NetHack (you can put the program in an AUTO folder if you want).
If you'll be running NetHack from a different subdirectory, you will
want to "set HACKDIR=\games\nethack" (or whatever directory you want to
use) now. Add it to your autoexec.bat (in DOS), if you'll be playing
often.
11. Play NetHack. If it works, you're done!
Notes
-----
1) Save files and bones files from previous versions will not work with
NetHack 3.0. Don't bother trying to keep them. Record (score) files
from before 3.0 patchlevel 7 will almost work, but you need to make one
change manually to them: At the end of each line is a word or phrase
specifying what killed the player. Change the string to start with the
words "killed by", "killed by a", or "killed by an" (whichever is
appropriate). If the death was petrification, it should read "petrified
by" instead of "killed by". Don't change "starvation", "quit", "escaped",
or "ascended".
2) To install an update of NetHack after changing something, enter "make"
from the src directory. If you add, delete, or reorder monsters or
objects, or you change the format of saved level files, delete any save
and bones files. (Trying to use such files sometimes produces amusing
confusions on the game's part, but usually crashes.)
3) During linking, the Microsoft Overlay Linker will need temporary storage
space to make the PC and OS/2 versions. Make sure you have
about a meg of free disk where ever you have defined your temporary
storage. It is also a good idea to compile with as much free RAM as
possible. It may otherwise get crowded with the bigger, more complex
source files. (Compiler bombs with "out of heap space" or similar.)
If this happens, strip your configuration, zap TSR's etc.
4) On a 286 10MHz PC you will have NetHack in about 2 - 2.5 hours.
5) Both OS/2 NetHack and the overlaid PC NetHack have been developed using
MSC 5.1. MSC 6.0 is on the market, but since there hasn't been enough
time to fully test the game compiled with MSC 6.0, the distribution version
supports officially only MSC 5.1. To compile NetHack with MSC 6.0, it may
be necessary to make some slight modifications to respective makefiles
as well as some source files. Also, when compiling OS/2 version with MSC
6.0, change library "doscalls" to "os2" in Makefile.os2.